PRINT #1,"Pass # "+STR$(k%)+" of "+STR$(numpairs%)+" for "+horig$
RELSEEK #1,0
'
donesummat!=FALSE
'
FOR outtype%=1 TO 4
'
IF outtype%=1
appnet$=".OUT"
append$=".FLO"
ELSE IF outtype%=2
appnet$=".CUT"
append$=".CLO"
ELSE IF outtype%=3
appnet$=".DUT"
append$=".DLO"
ELSE IF outtype%=4
appnet$=".HUT"
append$=".HLO"
ENDIF
'
IF append$=".FLO" AND (re.map%(k%,1)=re.map%(k%,5)) AND (re.map%(k%,2)=re.map%(k%,6)) AND (re.map%(k%,3)=re.map%(k%,7)) AND (re.map%(k%,4)=re.map%(k%,8))
GOTO sameflo
ENDIF
'
PRINT #1,"checking for *"+append$+" file to "+horig$;
RELSEEK #1,0
'
IF EXIST(outbound$+torig$+append$)
'
donesummat!=TRUE
PRINT #1," exists!"
RELSEEK #1,0
OPEN "I",#11,outbound$+torig$+append$,2048
'
' Only do something if orig .FLO file has size :-)
'
xx%=LOF(#11)
@log(log$,"R",torig$+append$+" found ("+STR$(xx%)+" bytes)")
@log(log$,"R","Appending to file: "+outbound$+tdest$+".FLO")
PRINT #1," Appending to file "+outbound$+tdest$+".FLO"
RELSEEK #1,0
comflag!=FALSE
OPEN "A",#12,outbound$+tdest$+".FLO"
ELSE
@log(log$,"R","Creating new file: "+outbound$+tdest$+".FLO")
PRINT #1," Creating new file "+outbound$+tdest$+".FLO"
RELSEEK #1,0
comflag!=TRUE
OPEN "O",#12,outbound$+tdest$+".FLO"
ENDIF
'
@gimmetheday
arcfilename$=HEX$(TIMER,8)+".P"+daynum$
IF re.map$(k%,2)=""
arcfilename$=outbound$+arcfilename$
ELSE
arcfilename$=re.map$(k%,2)+arcfilename$
ENDIF
arcfloadd!=FALSE
'
DO
exsuc!=FALSE
LINE INPUT #11,xx$
'
IF LEN(xx$)>1
raw$=xx$
raw$=TRIM$(raw$)
xx.circ$=RIGHT$(xx$,LEN(xx$)-1)
@giveroot(xx.circ$)
ELSE
raw$=""
ENDIF
'
IF LEFT$(raw$,1)="#"
'
IF (hashmove!=TRUE) AND (re.map$(k%,2)<>"") AND (EXIST(xx.circ$)) AND (LEN(raw$)>2)
'
ex$="Copy >RAM:PlutMap.tmp "+xx.circ$+" to "+re.map$(k%,2)+justname$+" CLONE"
EXEC ex$,-1,-1
'
IF NOT EXIST("Ram:PlutMap.tmp")
exsuc!=TRUE
ELSE
exsuc!=TRUE
OPEN "A",#63,"Ram:PlutMap.tmp"
aa%=LOF(#63)
SEEK #63,aa%
PRINT #63,""
CLOSE #63
'
OPEN "I",#62,"Ram:PlutMap.tmp"
DO
LINE INPUT #62,xx$
xx$=UPPER$(xx$)
RELSEEK #1,-1
IF (INSTR(xx$,"FAIL")) OR (INSTR(xx$,"CAN'T OPEN")) OR (INSTR(xx$,"ARGUMENT MISSING")) OR (INSTR(xx$,"NOT MOUNTED")) OR (INSTR(xx$,"DESTINATION")) OR (INSTR(xx$,"INFINITE")) OR (INSTR(xx$,"ERROR"))
exsuc!=FALSE
ENDIF
LOOP UNTIL EOF(#62)
CLOSE #62
'
ENDIF
'
IF EXIST("Ram:PlutMap.tmp")
KILL "Ram:PlutMap.tmp"
ENDIF
'
IF exsuc!
@log(log$,"R","Moved: "+justname$+" To dir: "+re.map$(k%,2))
PRINT #1," Moved: "+justname$+" To dir: "+re.map$(k%,2)
RELSEEK #1,-1
'
IF EXIST(xx.circ$)
KILL xx.circ$
' for #-files, replace with a null file, rather than delete
OPEN "O",#78,xx.circ$,16
CLOSE #78
ENDIF
'
PRINT #12,"#"+re.map$(k%,2)+justname$
ELSE
@log(log$,"R","Error - Couldn't move: "+justname$+" To dir: "+re.map$(k%,2))
PRINT #1," Error - Couldn't move: "+justname$+" To dir: "+re.map$(k%,2)
RELSEEK #1,-1
PRINT #12,raw$
ENDIF
'
'
ELSE
@log(log$,"R","Passed on: "+justname$+" For: "+horig$)
PRINT #1," Passed on: "+justname$+" For: "+horig$
RELSEEK #1,-1
PRINT #12,raw$
ENDIF
'
'
ELSE IF LEFT$(raw$,1)="-"
'
IF (minusmove!=TRUE) AND (re.map$(k%,2)<>"") AND (EXIST(xx.circ$)) AND (LEN(raw$)>2)
'
ex$="Copy >RAM:PlutMap.tmp "+xx.circ$+" to "+re.map$(k%,2)+justname$+" CLONE"
EXEC ex$,-1,-1
'
IF NOT EXIST("Ram:PlutMap.tmp")
exsuc!=TRUE
ELSE
exsuc!=TRUE
OPEN "A",#63,"Ram:PlutMap.tmp"
aa%=LOF(#63)
SEEK #63,aa%
PRINT #63,""
CLOSE #63
'
OPEN "I",#62,"Ram:PlutMap.tmp"
DO
LINE INPUT #62,xx$
xx$=UPPER$(xx$)
IF (INSTR(xx$,"FAIL")) OR (INSTR(xx$,"CAN'T OPEN")) OR (INSTR(xx$,"ARGUMENT MISSING")) OR (INSTR(xx$,"NOT MOUNTED")) OR (INSTR(xx$,"DESTINATION")) OR (INSTR(xx$,"INFINITE")) OR (INSTR(xx$,"ERROR"))
exsuc!=FALSE
ENDIF
LOOP UNTIL EOF(#62)
CLOSE #62
'
'
ENDIF
'
IF EXIST("Ram:PlutMap.tmp")
KILL "Ram:PlutMap.tmp"
ENDIF
'
IF exsuc!
@log(log$,"R","Moved: "+justname$+" To dir: "+re.map$(k%,2))
PRINT #1," Moved: "+justname$+" To dir: "+re.map$(k%,2)
RELSEEK #1,-1
IF EXIST(xx.circ$)
KILL xx.circ$
ENDIF
PRINT #12,"-"+re.map$(k%,2)+justname$
ELSE
@log(log$,"R","Error - Couldn't move: "+justname$+" To dir: "+re.map$(k%,2))
PRINT #1," Error - Couldn't move: "+justname$+" To dir: "+re.map$(k%,2)
RELSEEK #1,-1
PRINT #12,raw$
ENDIF
'
'
ELSE
@log(log$,"R","Passed on: "+justname$+" For: "+horig$)
PRINT #1," Passed on: "+justname$+" For: "+horig$
RELSEEK #1,-1
PRINT #12,raw$
ENDIF
'
'
ELSE IF LEFT$(raw$,1)="^"
'
IF (caretmove!=TRUE) AND (re.map$(k%,2)<>"") AND (EXIST(xx.circ$)) AND (LEN(raw$)>2)
'
ex$="Copy >RAM:PlutMap.tmp "+xx.circ$+" to "+re.map$(k%,2)+justname$+" CLONE"
EXEC ex$,-1,-1
'
IF NOT EXIST("Ram:PlutMap.tmp")
exsuc!=TRUE
ELSE
exsuc!=TRUE
OPEN "A",#63,"Ram:PlutMap.tmp"
aa%=LOF(#63)
SEEK #63,aa%
PRINT #63,""
CLOSE #63
'
OPEN "I",#62,"Ram:PlutMap.tmp"
DO
LINE INPUT #62,xx$
xx$=UPPER$(xx$)
IF (INSTR(xx$,"FAIL")) OR (INSTR(xx$,"CAN'T OPEN")) OR (INSTR(xx$,"ARGUMENT MISSING")) OR (INSTR(xx$,"NOT MOUNTED")) OR (INSTR(xx$,"DESTINATION")) OR (INSTR(xx$,"INFINITE")) OR (INSTR(xx$,"ERROR"))
exsuc!=FALSE
ENDIF
LOOP UNTIL EOF(#62)
CLOSE #62
'
ENDIF
'
IF EXIST("Ram:PlutMap.tmp")
KILL "Ram:PlutMap.tmp"
ENDIF
'
IF exsuc!
@log(log$,"R","Moved: "+justname$+" To dir: "+re.map$(k%,2))
PRINT #1," Moved: "+justname$+" To dir: "+re.map$(k%,2)
RELSEEK #1,-1
IF EXIST(xx.circ$)
KILL xx.circ$
ENDIF
PRINT #12,"^"+re.map$(k%,2)+justname$
ELSE
@log(log$,"R","Error - Couldn't move: "+justname$+" To dir: "+re.map$(k%,2))
PRINT #1," Error - Couldn't move: "+justname$+" To dir: "+re.map$(k%,2)
RELSEEK #1,-1
PRINT #12,raw$
ENDIF
'
'
ELSE
@log(log$,"R","Passed on: "+justname$+" For: "+horig$)
PRINT #1," Passed on: "+justname$+" For: "+horig$
RELSEEK #1,-1
PRINT #12,raw$
ENDIF
'
ELSE IF LEFT$(raw$,1)="~"
'
IF (tildemove!=TRUE) AND (re.map$(k%,2)<>"") AND (EXIST(xx.circ$)) AND (LEN(raw$)>2)
'
ex$="Copy >RAM:PlutMap.tmp "+xx.circ$+" to "+re.map$(k%,2)+justname$+" CLONE"
EXEC ex$,-1,-1
'
IF NOT EXIST("Ram:PlutMap.tmp")
exsuc!=TRUE
ELSE
exsuc!=TRUE
OPEN "A",#63,"Ram:PlutMap.tmp"
aa%=LOF(#63)
SEEK #63,aa%
PRINT #63,""
CLOSE #63
'
OPEN "I",#62,"Ram:PlutMap.tmp"
DO
LINE INPUT #62,xx$
xx$=UPPER$(xx$)
IF (INSTR(xx$,"FAIL")) OR (INSTR(xx$,"CAN'T OPEN")) OR (INSTR(xx$,"ARGUMENT MISSING")) OR (INSTR(xx$,"NOT MOUNTED")) OR (INSTR(xx$,"DESTINATION")) OR (INSTR(xx$,"INFINITE")) OR (INSTR(xx$,"ERROR"))
exsuc!=FALSE
ENDIF
LOOP UNTIL EOF(#62)
CLOSE #62
'
ENDIF
'
IF EXIST("Ram:PlutMap.tmp")
KILL "Ram:PlutMap.tmp"
ENDIF
'
IF exsuc!
@log(log$,"R","Moved: "+justname$+" To dir: "+re.map$(k%,2))
PRINT #1," Moved: "+justname$+" To dir: "+re.map$(k%,2)
RELSEEK #1,-1
IF EXIST(xx.circ$)
KILL xx.circ$
ENDIF
PRINT #12,"~"+re.map$(k%,2)+justname$
ELSE
@log(log$,"R","Error - Couldn't move: "+justname$+" To dir: "+re.map$(k%,2))
PRINT #1," Error - Couldn't move: "+justname$+" To dir: "+re.map$(k%,2)
RELSEEK #1,-1
PRINT #12,raw$
ENDIF
'
ELSE
@log(log$,"R","Passed on: "+justname$+" For: "+horig$)
PRINT #1," Passed on: "+justname$+" For: "+horig$
RELSEEK #1,-1
PRINT #12,raw$
ENDIF
'
ELSE IF (re.map$(k%,1)="P") AND (EXIST(raw$)) AND (LEN(raw$)>2)
'
ex$=packcmd$+" "+arcfilename$+" "+raw$
@log(log$,"R","Executing: "+ex$)
PRINT #1,"Archiving "+justname$+" for "+horig$
RELSEEK #1,-1
'
EXEC ex$,-1,-1
'
IF NOT EXIST("Ram:PlutMap.tmp")
exsuc!=TRUE
ELSE
exsuc!=TRUE
OPEN "A",#63,"Ram:PlutMap.tmp"
aa%=LOF(#63)
SEEK #63,aa%
PRINT #63,""
CLOSE #63
'
OPEN "I",#62,"Ram:PlutMap.tmp"
DO
LINE INPUT #62,xx$
xx$=UPPER$(xx$)
IF (INSTR(xx$,"FAIL")) OR (INSTR(xx$,"CAN'T OPEN")) OR (INSTR(xx$,"ARGUMENT MISSING")) OR (INSTR(xx$,"NOT MOUNTED")) OR (INSTR(xx$,"INFINITE")) OR (INSTR(xx$,"ERROR"))
exsuc!=FALSE
ENDIF
LOOP UNTIL EOF(#62)
CLOSE #62
ENDIF
'
IF exsuc!=FALSE
@log(log$,"R","Archiving to "+arcfilename$+" Failed!")
PRINT #1,"Archiving to "+arcfilename$+" Failed!"
RELSEEK #1,-1
@log(log$,"R","Passed on: "+raw$+" For: "+horig$)
PRINT #1," Passed on: "+raw$+" For: "+horig$
RELSEEK #1,-1
PRINT #12,raw$
ELSE
PRINT #1,"Archiving to "+arcfilename$+" all okay"
RELSEEK #1,-1
IF arcfloadd!=FALSE
PRINT #12,"-"+arcfilename$
arcfloadd!=TRUE
ENDIF
@log(log$,"R","Added: "+justname$+" to "+arcfile$+" For: "+horig$)
'
koff!=TRUE
FOR zq%=1 TO numnodelete%
IF INSTR(UPPER$(raw$),no.kill$(zq%))>0
koff!=FALSE
ENDIF
NEXT zq%
'
IF koff!
IF EXIST(raw$)
KILL raw$
ENDIF
@log(log$,"R","Deleted "+raw$)
PRINT #1,"Deleted "+raw$
RELSEEK #1,-1
ELSE
@log(log$,"R",raw$+" not deleted (overridden from cfg)")
PRINT #1,raw$+" not deleted (overridden from cfg)"
RELSEEK #1,-1
ENDIF
'
ENDIF
'
IF EXIST("Ram:PlutMap.tmp")
KILL "Ram:PlutMap.tmp"
ENDIF
'
ELSE
'
IF (LEN(re.map$(k%,2))>2) AND EXIST(raw$) AND (LEN(raw$)>2)
'
ex$="Copy >RAM:PlutMap.tmp "+raw$+" to "+re.map$(k%,2)+justname$+" CLONE"
EXEC ex$,-1,-1
'
IF NOT EXIST("Ram:PlutMap.tmp")
exsuc!=TRUE
ELSE
exsuc!=TRUE
OPEN "A",#63,"Ram:PlutMap.tmp"
aa%=LOF(#63)
SEEK #63,aa%
PRINT #63,""
CLOSE #63
'
OPEN "I",#62,"Ram:PlutMap.tmp"
DO
LINE INPUT #62,xx$
xx$=UPPER$(xx$)
IF (INSTR(xx$,"FAIL")) OR (INSTR(xx$,"CAN'T OPEN")) OR (INSTR(xx$,"ARGUMENT MISSING")) OR (INSTR(xx$,"NOT MOUNTED")) OR (INSTR(xx$,"DESTINATION")) OR (INSTR(xx$,"INFINITE")) OR (INSTR(xx$,"ERROR"))
exsuc!=FALSE
ENDIF
LOOP UNTIL EOF(#62)
CLOSE #62
'
ENDIF
'
IF EXIST("Ram:PlutMap.tmp")
KILL "Ram:PlutMap.tmp"
ENDIF
'
IF exsuc!
@log(log$,"R","Moved: "+justname$+" To dir: "+re.map$(k%,2))
PRINT #1," Moved: "+justname$+" To dir: "+re.map$(k%,2)
RELSEEK #1,-1
IF EXIST(raw$)
KILL raw$
ENDIF
PRINT #12,re.map$(k%,1)+re.map$(k%,2)+justname$
ELSE
@log(log$,"R","Error - Couldn't move: "+justname$+" To dir: "+re.map$(k%,2))
PRINT #1," Error - Couldn't move: "+justname$+" To dir: "+re.map$(k%,2)
RELSEEK #1,-1
PRINT #12,raw$
ENDIF
'
ELSE
@log(log$,"R","Passed on: "+justname$+" For: "+horig$)
PRINT #1," Passed on: "+justname$+" For: "+horig$
RELSEEK #1,-1
PRINT #12,raw$
ENDIF
'
'
'
ENDIF
LOOP UNTIL EOF(#11)
CLOSE #12
'
' Does the .FLO file we made need a comment?
'
IF comflag!
xx$=outbound$+tdest$+".FLO"+CHR$(0)
xc$="To "+hdest$+"; "+CHR$(0)
'
~SetComment(V:xx$,V:xc$)
'
ENDIF
'
ENDIF
CLOSE #11
KILL outbound$+torig$+append$
'
'
ELSE
PRINT #1," not today!"+CHR$(10)+CHR$(27)+"[A"+CHR$(27)+"[K";